<template>
  <div class='config-main'>
    <h2>数据源配置</h2>
    <div class='content-menu'>
      <el-form ref="search" :model="searchData" size="small" style='position:relative'>
        <el-form-item label="状态:">
          <span>{{searchData.name}}</span>
        </el-form-item>
        <el-form-item label="创建时间:">
          <span>{{searchData.num1}}</span>
        </el-form-item>
        <el-form-item label="创建人:">
          <span>{{searchData.num2}}</span>
        </el-form-item>
        <el-form-item label="状态更新时间:">
          <span>{{searchData.num3}}</span>
        </el-form-item>
        <el-form-item label="描述:" style='width:100%'>
          <span>{{searchData.num4}}</span>
        </el-form-item>
        <el-form-item style='text-align: right;position:absolute;right:0;top:20px'>
          <el-dropdown size="small" split-button type="primary">
            更新状态
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>黄金糕</el-dropdown-item>
              <el-dropdown-item>狮子头</el-dropdown-item>
              <el-dropdown-item>螺蛳粉</el-dropdown-item>
              <el-dropdown-item>双皮奶</el-dropdown-item>
              <el-dropdown-item>蚵仔煎</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-form-item>
      </el-form>
    </div>
    <div class='content-main'>
      <div class='pageMenu'>
        <el-radio-group v-model="page" size='medium'>
          <el-radio-button label="1">高级操作</el-radio-button>
          <el-radio-button label="2">操作记录</el-radio-button>
        </el-radio-group>
      </div>
      <div class='pageCont'>
        <table-list v-if='page==2' :chacked='searchData'></table-list>
        <div v-else style='text-align: center;'> 正在开发中，敬请期待。。。</div>
      </div>
    </div>
  </div>
</template>

<script>
  import TableList from './components/TableList'
  export default {
    name: 'dataSouce',
    components: {
      TableList
    },
    data() {
      return {
        searchData: {
          name: '正常',
          num1: '1',
          num2: '2',
          num3: '3',
          num4: '4'
        },
        page: '2'
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss">
  .config-main {
    padding: 0 20px 20px 20px;
    color: #666;
    h2 {
      height: 56px;
      line-height: 56px;
      color: #333;
      font-weight: normal;
      font-size: 18px;
    }
    .content-menu {
      background: #fff;
      padding: 20px;
      .el-form {
        .el-form-item {
          display: inline-block;
          width: 49%;
        }
      }
    }
    .content-main {
      background: #fff;
      margin-top: 20px;
      padding: 20px;
      .pageMenu {
        text-align: right;
        .el-radio-button__inner {
          width: 88px;
          text-align: center;
          &:hover {
            color: #1989fa;
          }
        }
        .el-radio-button__orig-radio:checked+.el-radio-button__inner {
          background-color: #e6f1fc;
          color: #1989fa;
          border-color: #a3d0fd;
          -webkit-box-shadow: -1px 0 0 0 #a3d0fd;
          box-shadow: -1px 0 0 0 #a3d0fd;
        }
      }
      .pageCont {
        padding-top: 20px;
      }
    }
  }
</style>